{include file="./headStart.tpl"}
<script type="text/javascript" src="./js/jquery.colorbox.js"></script>
<script type="text/javascript" src="./js/Modal.js"></script>
<link media="screen" rel="stylesheet" href="./css/colorbox.css" />
<link rel="stylesheet" type="text/css" href="./css/SModal.css">
{literal}
<script type="text/javascript">
var i = 0;
$(document).ready(function() 
{
	$("#aa").hide(); 
  // To change nextAction : Starts
//  $(".nextAction").change(function(){
//    nextActionPlan($(this));
//  });
//   // To change nextAction : End
 $(".add").click(function(a){
   $("#one").clone(true).appendTo("#mainDiv").find('input[type="text"]').val('');
   nextActionPlan($(this));
   addRow();
  });
});
function modelWindow()
{
  jQuery('.newCust').colorbox({ maxWidth: '75%', onComplete: function(){
  jQuery("#frmParty").submit(function(){
  	var categoryNameVar = $("#companyName").val();
    jQuery.post(
      jQuery(this).attr('action'),
      jQuery(this).serialize(),
      function(data){
      	$("<option value='"+data+"' SELECTED>"+categoryNameVar+"</option>").appendTo(".partyId:last");
        $.colorbox.close();
      }
    );
   return false;
  });
  }
  });
}
function formvalidation()
{
  var data0 = $(".partyId:last").val();
  var data1 = $(".custIdClass:last").val();
  
  if(data0 == 0) 
  { 
    alert("Please select any  Coustmer"); 
    $(".User").focus(); 
    return false; 
  } 
  if(data1 == 0) 
  { 
    alert("Please select any Conclusion"); 
    $(".custIdClass").focus(); 
    return false; 
  }  
}

function nextActionPlan(theObj)
{
  if($(theObj).val() == 1)
  {
    $(theObj).next("div").show();  
    
		setTimeout(function() {
		      $(".dayClass").focus();
		}, 50);    
  }
  else
  {
    $(theObj).next("div").hide();    
  }
}
function addRow() 
{
  var countSr = 1;
    $('.srNoClass').each(function()
    {
      this.value = countSr++;
    });
    return false;
}
 function deleteRow() 
{
  var countSr = 1;
    $('.delete').click(function()
    {
      $(this).parent().parent().remove();
      $('.srNoClass').each(function()
      {
        this.value = countSr++;
      });
        return false;
     });
}
</script>
{/literal}
{include file="./headEnd.tpl"}
Today's Date : {$currentCreateDate}
<form name="form1" action="{$smarty.server.PHP_SELF}" id="form" method="post">
<table align="center" border="1" cellpadding="2" cellspacing="1" >
<tr>
  <td align="center" class="table1" colspan="6">Daily Report</td>
</tr>
<tr>
  <td align="left" class="table2">User : </td>
  <td class="table2">
    <select name="userId" id="userId" disabled>
      {html_options values=$userId output=$userName selected=$s_activeUserId}
     </select>
  </td>
  <td align="right" class="table2" >For The Date : </td>
    <td NOWRAP class="table2">
      {html_select_date time="$reportDateSelected" prefix="reportDate" start_year="-3" end_year="+1" month_format="%m" field_order="DMY" day_value_format="%02d"}
    </td>
  <td align="right" class="table2"><a href="userTargetAchieved.php" class="newOrder" id="newOrder">New Order Value</a></td>
</tr>
</table><br />
<table align="center" border="1"  cellpadding="1" cellspacing="0">
<tr>
  <td colspan="4"> 
    <table align="center" border="0" id="dataTable" width="100" cellpadding="2" cellspacing="0">
      <tr>
        <th class="table1" align="center">SR. NO.</th>
        <th class="table1" align="center" colspan="2">Customer</th>
        <th class="table1" align="center">Outcome</th>
        <th class="table1" align="center">Conclusion</th>
        <td class="table1" align="center"><B>&nbsp;</td>
        <td class="table1" align="center"><B>&nbsp;</td>
      </tr>
      {assign var="name" value=1}
      <tbody id="mainDiv">
        <tr id="one">
          <td class="table2" width=""><input type="text" class="srNoClass" name="srNo[]" size="5" value="1" DISABLED></td>
          <td class="table2"><select name="partyId[]" id="partyId" class="partyId">
            <option value="0">Name</option>
            {html_options values=$partyId output=$companyName}</select>
            </td>
          <td class="table2"><a href="partyAj.php" class="newCust user" id="newCust" onClick="modelWindow()" />New Customer</a></td>
          <td class="table2"><textarea name="outCome[]"  rows="1" cols="39">{$outCome}</textarea></td>
          <td class="table2" NOWRAP>
            <select name="typeOfConclusionId[]" id="typeOfConclusionId" class="nextAction custIdClass" onchange="nextActionPlan(this);">
              <option value=0 >Select</option>
              {html_options values=$typeOfConclusionId output=$typeOfConclusion}
            </select>
            <div id="aa">
						  <label for="followUpDateSpan"><b>FollowUp Date</b></label>
						  <span id="followUpDateSpan">{html_select_date field_array="nextFollowUp[]" day_extra='class="dayClass"' prefix="" start_year="-3" end_year="+1" month_format="%m" field_order="DMY" day_value_format="%02d"}</span><br />
						  <label for="remarksSpan"><b>Next Action</b></label>
						  <span id="remarksSpan"><textarea name="remarks[]" id="remarks" rows="1" cols="40">{$dailyReportDetailArray[sec].remarks}</textarea></span>
            </div>
          </td>
          <td class="table2"><input type="button" name="add"  class="add" value="Add" /></td>
          <td class="table2"><input type="button" value="Delete" name="deleteBtn"  class="delete" onclick="deleteRow()"/></td>
        </tr>
      </tbody>
    </table>
  </td>   
</tr>
</table>
<table border="1" align="center">
	<tr>
	  <td align="center" class="table1">Market Feedback</td>
    <td align="center" class="table1">Competitor Information</td>
  </tr>
  <tr>
	  <td align="center" class="table1"><textarea name="marketFeedback" rows="3" cols="55"></textarea></td>
    <td align="center" class="table1"><textarea name="compInformation" rows="3" cols="55"></textarea></td>
  </tr>
</table>
<table border="0" align="center">
  <tr>
    <td align="center" colspan="3">
      <input type="submit" value="SUBMIT" name="submitBtn" onclick="return formvalidation(this);" />
      <input type="submit" value="CANCEL" name="cancelBtn" />
    </td>
  </tr>
  <tr><td colspan="3">&nbsp;</td></tr>
  <tr>
    <td align="center" class="table1">Target For The Month</td>
    <td align="center" class="table1">Achieved Till Date</td>
    <td align="center" class="table1">Balance Target</td>
  </tr>
  <tr>
    <td align="center" class="table3"><b>{$target}</td>
    <td align="center" class="table3"><b>{$achievedTarget}</td>
    <td align="center" class="table3"><b>{$totalBalanceTarget}</td>
  </tr>
</table>
</form>
{include file="footer.tpl"}